/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 优惠券兑换记录新增 POST /api/redeem/add */
export async function addUsingPost2({
  body,
  options,
}: {
  body: API.youhuiquanduihuanjiluchuangjiancanshu;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultobject>('/api/redeem/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 优惠券兑换记录删除 POST /api/redeem/del */
export async function delUsingPost2({
  body,
  options,
}: {
  body: API.IDcanshu;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultobject>('/api/redeem/del', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 优惠券兑换记录详情 GET /api/redeem/detail */
export async function detailUsingGet5({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.detailUsingGET5Params;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultyouhuiquanduihuanjiluxiangqingVo>(
    '/api/redeem/detail',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 优惠券兑换记录编辑 POST /api/redeem/edit */
export async function editUsingPost2({
  body,
  options,
}: {
  body: API.youhuiquanduihuanjilugengxincanshu;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultobject>('/api/redeem/edit', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 优惠券兑换记录列表 GET /api/redeem/list */
export async function listUsingGet6({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.listUsingGET6Params;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultPageResultyouhuiquanduihuanjiluliebiaoVo>(
    '/api/redeem/list',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
